package cn.lgs.com.mobileplayer.mvp.model.impl;

import android.content.Context;

import org.json.JSONException;
import org.json.JSONObject;

import cn.lgs.com.mobileplayer.entity.QueryPondAssetBean;
import cn.lgs.com.mobileplayer.http.ApiService;
import cn.lgs.com.mobileplayer.http.NetCheckUtils;
import cn.lgs.com.mobileplayer.http.RetrofitUtils;
import cn.lgs.com.mobileplayer.mvp.model.IQueryPondAssetModel;
import okhttp3.MediaType;
import okhttp3.RequestBody;

/**
 * Created by lgs on 2017/12/11.
 */

public class QueryPondAssetModelImpl implements IQueryPondAssetModel {


    @Override
    public void requestData(Context context, IQueryPondAssetModelCallback modelCallback) {

        //加载数据
        JSONObject jsonObject = new JSONObject();
        try {
            jsonObject.put("methodName", "queryPondAsset");
        } catch (JSONException e) {
            e.printStackTrace();
        } finally {
            if (NetCheckUtils.isNetworkConnected(context)) {
                ApiService apiService = RetrofitUtils.getInstance(context).getApiService(ApiService.class);
                String authorization = "测试";
                RequestBody requestBody = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), jsonObject.toString());
//                apiService.zyQueryPondAsset(authorization, requestBody).enqueue();
            }
        }



        QueryPondAssetBean bean = new QueryPondAssetBean();
        //返回数据
        modelCallback.responseData(bean);

    }
}
